package com.zt.ztyh.service;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zt.ztyh.dto.LoanDto;
import com.zt.ztyh.dto.LoanUser;
import com.zt.ztyh.entity.User;
import com.zt.ztyh.vo.loan.LoanVo;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;
import java.util.List;

@FeignClient(name = "loan-user",path = "/ztyh/loanUser")
public interface LoanUserService {

    //添加贷款
    @PostMapping("/addLoan")
    @Operation(summary = "添加贷款信息")
    public boolean addLoan(@RequestBody com.zt.ztyh.dto.LoanUser loanUser);

    //查询贷款额度
    @GetMapping("/findUserLoanLimit/{uid}")
    @Operation(summary = "根据用户id查询贷款额度")
    BigDecimal findUserLoanLimit(@PathVariable("uid") Long uid);

    //查询用户的信息
    @GetMapping("/findUserInfo/{uid}")
    @Operation(summary = "根据用户id查询用户信息")
     User findUserInfo(@PathVariable("uid") Long uid);

    //查询个人所贷款信息
    @PostMapping("/findUserLoan")
    @Operation(summary = "根据用户id查询贷款信息")
    public Page<LoanVo> findUserLoan(@RequestBody LoanDto loanDto);

    //查询贷款信息
    @GetMapping("/getById/{id}")
    @Operation(summary = "根据id查询贷款信息")
     LoanUser getById(@PathVariable("id") Long id);


    @PutMapping("/updateById")
    @Operation(summary = "根据id更新贷款信息")
    public boolean updateById(@RequestBody LoanUser loanUser);
}
